<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dbshop-menu-top">
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('保存客服信息'); ?></button>
            <?php echo $this->HelpUrl('onlineService'); ?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?php echo $this->translate('在线客服设置'); ?></h3>
                    </div>

                    <div class="box-body">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('珑客服ID'); ?></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('longServiceId')); ?>
                                <?php echo $this->formElementErrors($form->get('longServiceId'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('displayRange')); ?>
                                <?php echo $this->formElementErrors($form->get('displayRange'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('终端显示'); ?></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('client')); ?>
                                <?php echo $this->formElementErrors($form->get('client'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('在线客服1'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineType1')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineType1'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineTitle1')->setAttributes(['placeholder' => $this->translate('客服名称')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineTitle1'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineAccount1')->setAttributes(['placeholder' => $this->translate('客服账号')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineAccount1'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineDisplayRange1')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineDisplayRange1'), ['class'=>'error-message']); ?>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('在线客服2'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineType2')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineType2'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineTitle2')->setAttributes(['placeholder' => $this->translate('客服名称')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineTitle2'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineAccount2')->setAttributes(['placeholder' => $this->translate('客服账号')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineAccount2'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineDisplayRange2')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineDisplayRange2'), ['class'=>'error-message']); ?>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('在线客服3'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineType3')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineType3'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineTitle3')->setAttributes(['placeholder' => $this->translate('客服名称')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineTitle3'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineAccount3')->setAttributes(['placeholder' => $this->translate('客服账号')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineAccount3'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineDisplayRange3')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineDisplayRange3'), ['class'=>'error-message']); ?>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('在线客服4'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineType4')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineType4'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineTitle4')->setAttributes(['placeholder' => $this->translate('客服名称')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineTitle4'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineAccount4')->setAttributes(['placeholder' => $this->translate('客服账号')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineAccount4'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineDisplayRange4')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineDisplayRange4'), ['class'=>'error-message']); ?>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('在线客服5'); ?></label>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineType5')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineType5'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-2">
                                <?php echo $this->formElement($form->get('onlineTitle5')->setAttributes(['placeholder' => $this->translate('客服名称')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineTitle5'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineAccount5')->setAttributes(['placeholder' => $this->translate('客服账号')])); ?>
                                <?php echo $this->formElementErrors($form->get('onlineAccount5'), ['class'=>'error-message']); ?>
                            </div>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineDisplayRange5')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineDisplayRange5'), ['class'=>'error-message']); ?>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('终端显示'); ?></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('onlineClient')); ?>
                                <?php echo $this->formElementErrors($form->get('onlineClient'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                currencyCode: {
                    required: true
                },
                currencyRate: {
                    required: true
                }
            },
            messages: {
                currencyCode: {
                    required: "<?php echo $this->translate('请选择货币'); ?>"
                },
                currencyRate: {
                    required: "<?php echo $this->translate('汇率不能为空'); ?>"
                }
            }
        });
    });
</script>